﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Text;

namespace SHomeWorkshop.LunarMind.Converts
{
    /// <summary>
    /// 当工具条上的按钮被禁用时使用。表示禁用的图片使用这个转换器。
    /// </summary>
    [ValueConversion(typeof(bool), typeof(System.Windows.Visibility))]
    public class IsUnableConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((bool)value == false)
            {
                return System.Windows.Visibility.Visible;
            }
            else return System.Windows.Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }

        #endregion
    }
}
